home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #
- # Simple script to implement "array who"
- #
- # Usage: awho local <name>
- # or: awho merge <file....>
- #
-
- if [ "$1" = "local" ]; then
-
- w |\
- tail +3 |\
- nawk 'BEGIN { Host = "'$2'" }; \
- { printf "%-8s %-12s %-14s %s\n", \
- $1, Host, substr($0, 14, 14), substr($0, 59) }'
-
- elif [ "$1" = "merge" ]; then
-
- shift 1
- echo "User Machine From What"
- echo "----------------------------------------------------------"
- sort $*
-
- else
-
- echo "Usage: awho local <hostname>"
- echo " or: awho merge <output-file>..."
-
- fi
-
-